/*
 *	Copyright © 2013 Changsha Shishuo Network Technology Co., Ltd. All rights reserved.
 *	长沙市师说网络科技有限公司 版权所有
 *	http://www.shishuo.com
 */

package com.hlingsoft.kkh.dao;

import com.hlingsoft.kkh.entity.Likes;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 用户服务
 *
 * @author Zhang jiale
 *
 */

@Repository
public interface LikesDao {


	/**
	 * 点赞
	 *
	 * @param likes
	 * @return Integer
	 */
	public int addLikes( Likes likes);


	/**
	 * 更新likes
	 *
	 * @param likes
	 * @return
	 */
	public int updateLikes (Likes likes);


	/**
	 * 获取活动获得的赞
	 * @param eventsId
	 * @return
	 */
	public List<Likes> getLikesByEventsId(@Param("eventsId") long eventsId,@Param("offset") int offset,@Param("rows") int rows );


	public List<Likes> getLikesByEventsIdWithNone(@Param("eventsId") long eventsId);


	/**
	 * 获取所有赞
	 * @param eventsId
	 * @return
	 */
	public List<Likes> getAllLikesByEventsId(@Param("eventsId") long eventsId );


	/**
	 * 获取活动获得赞的人（无重复）
	 * @param eventsId
	 * @param offset
	 * @param rows
	 * @return
	 */
	public List<Likes> getLikesByEventsId2(@Param("eventsId") long eventsId,@Param("offset") int offset,@Param("rows") int rows );

	/**
	 * 活动的赞数
	 * @param eventsId
	 * @return
	 */
	public int getLikesByEventsIdCount(@Param("eventsId") long eventsId );

	/**
	 * 通过被点赞人查找
	 * @param appUserId
	 * @return
	 */
	public List<Likes>  getLikesByAppUserId(@Param("appUserId") long appUserId);


	public List<Likes>  getAllLikesByAppUserId(@Param("appUserId") long appUserId);

	/**
	 * 获取评论得赞数
	 * @param eventCommentsId
	 * @return
	 */
	public List<Likes> getLikesByEventCommentsId(@Param("eventCommentsId") long eventCommentsId,@Param("offset")int offset,@Param("rows")int rows);


	public List<Likes> getLikesByEventCommentsIdWithNone(@Param("eventCommentsId") long eventCommentsId);

	public int getLikesByEventCommentsIdCount(@Param("eventCommentsId") long eventCommentsId);

	/**
	 * 判断是否对活动点赞
	 * @param myId
	 * @param eventsId
	 * @return
	 */
	public List<Likes> getIsLikes(@Param("myId")long myId,@Param("eventsId")long eventsId);


	/**
	 * 判断是否对跟帖点赞
	 * @param myId
	 * @param eventCommentsId
	 * @return
	 */
	public List<Likes> getCIsLikes(@Param("myId")long myId,@Param("eventCommentsId")long eventCommentsId);

	/**
	 * 点过赞的活动
	 * @param myId
	 * @return
	 */
	public List<Likes> getLikesEvents(@Param("myId")long myId);


	/**
	 * 我点过的赞
	 * @param myId
	 * @return
	 */
	public List<Likes> getLikesByMyId(@Param("myId")long myId);


	/**
	 * 与用户相关的点赞
	 * @param appUserId
	 * @return
	 */
	public List<Likes> getLikesByAppUserIdWithNone(@Param("appUserId")long appUserId);

}
